/*
 * // +-------------------------------------------------------------------------------------------------
 * // |                 有你就好 [ 有节骨乃坚，无心品自端 ]     <http://encoding.wang>
 * // +-------------------------------------------------------------------------------------------------
 * // |                             独在异乡为异客         每逢佳节倍思亲
 * // +-------------------------------------------------------------------------------------------------
 * // |                 联系:   <707069100@qq.com>      <http://weibo.com/513778937>
 * // +-------------------------------------------------------------------------------------------------
 */

// -----------------------------------------------------------------------------------------------------
// +----------------------------------------------------------------------------------------------------
// |                   ErYang出品 属于小极品          共同学习    共同进步
// +----------------------------------------------------------------------------------------------------
// -----------------------------------------------------------------------------------------------------


package wang.encoding.mroot.plugin.ueditor.controller;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import org.springframework.web.bind.annotation.RestController;
import wang.encoding.mroot.plugin.ueditor.ActionEnter;


/**
 * 上传处理
 *
 * @author ErYang
 */
@RestController
@RequestMapping("/ueditor")
public class UeditorController {

    private final ActionEnter actionEnter;

    @Autowired
    public UeditorController(ActionEnter actionEnter) {
        this.actionEnter = actionEnter;
    }

    @ResponseBody
    @RequestMapping("/upload")
    public JSONObject exe(final HttpServletRequest request, final HttpServletResponse response) {
        //response.setCharacterEncoding("UTF-8");
        //response.setContentType("application/json");
        return JSON.parseObject(actionEnter.exec(request));
    }

    // -------------------------------------------------------------------------------------------------

}

// -----------------------------------------------------------------------------------------------------

// End UeditorController class

/* End of file UeditorController.kt */
/* Location: ./src/main/kotlin/wang/encoding/mroot/plugin/ueditor/controller/UeditorController.kt */

// -----------------------------------------------------------------------------------------------------
// +----------------------------------------------------------------------------------------------------
// |                           ErYang出品 属于小极品  O(∩_∩)O~~   共同学习    共同进步
// +----------------------------------------------------------------------------------------------------
// -----------------------------------------------------------------------------------------------------
